#print-head,
#print-foot {
    display: none;
}


@media print {
    h1 {
        page-break-after: always;
        padding-top: 2em;
    }

    h1:first-child {
        page-break-before: avoid;
        counter-reset: page;
    }

    #print-head {
        display: block;
        position: fixed;
        top: 0pt;
        left: 0pt;
        right: 0pt;

        font-size: 200%;
        text-align: center;
    }

    #print-foot {
        display: block;
        position: fixed;
        bottom: 0pt;
        right: 0pt;

        font-size: 200%;
    }

    #print-foot:after {
        content: counter(page);
        counter-increment: page;
    }
}
